﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tedds_Tool.RulesBase;
using System.IO;

namespace RulesBase.Model
{
    class Consequence : IConsequence
    {
        public Consequence(string name, string msg)
        {
            Name = name;
            Message = msg;
        }
        
        public string Name
        {
            get;
            private set;
        }

        public string Message
        {
            get;
            private set;
        }

        internal static IConsequence Load(string name, Tedds_Tool.IScriptFinder finder)
        {
            using(TextReader reader = finder.FindConsequence(name)){
                return new Consequence(name, reader.ReadToEnd());
            }
        }
    }
}
